/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package treeship.core.service.xml;

import java.util.List;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;

/**
 *
 * @author Moonchild
 */
public class DocumentWrapper {

    private Document document;

    public DocumentWrapper(Document document) {
        this.document = document;
    }

    public List<NodeWrapper> getListChildrenOfStaticTag(String tagname) {
        NodeList listProperty = document.getElementsByTagName(tagname).item(0).getChildNodes();

        return XMLReader.getListOfNodeWrappers(listProperty);
//        List<NodeWrapper> li = new ArrayList<NodeWrapper>();
//        for (int i = 0; i < listProperty.getLength(); i++) {
//            Node item = listProperty.item(i);
//            if (item.getNodeType() == Node.ELEMENT_NODE) {
//                li.add(new NodeWrapper(item));
//            }
//        }
//        return li;
    }
}
